<?php

     echo <<<endHTML
<html>
<head><title>clear ALL datbase Information including Horse names</title></head>
<body bgcolor = "black">
<center> <FONT color="yellow"  SIZE=7> <b>
Warning <br>
<font SIZE=5> THIS WILL CLEAR THE ENTIRE DATABASE OF INFORMATION <br>
Leaving only an empty Database ready to re-populate<br>
please ensure you ave read the readme.txt file.
 </b> <br> <br> </font>
<FONT  SIZE=3 > <b>
<table border="1">
<tr> 

</tr>    
endHTML;
if(isSet($_POST['clear'])){
$db=sqlite_open("horse.db");
sqlite_query($db, "UPDATE race SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race1 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race1 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race1 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race2 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race2 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race2 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race3 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race3 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race3 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race4 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race4 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race4 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race5 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race5 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race5 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race6 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race6 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race6 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race7 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race7 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race7 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race8 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race8 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race8 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race9 SET payout ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race9 SET bets ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race9 SET decimal_odds ='0'",$sqliteerror);
sqlite_query($db, "UPDATE race2 SET horse_name =''");
sqlite_query($db, "UPDATE race SET horse_name =''");
sqlite_query($db, "UPDATE race1 SET horse_name =''");
sqlite_query($db, "UPDATE race3 SET horse_name =''");
sqlite_query($db, "UPDATE race4 SET horse_name =''");
sqlite_query($db, "UPDATE race5 SET horse_name =''");
sqlite_query($db, "UPDATE race6 SET horse_name =''");
sqlite_query($db, "UPDATE race7 SET horse_name =''");
sqlite_query($db, "UPDATE race8 SET horse_name =''");
sqlite_query($db, "UPDATE race9 SET horse_name =''");

sqlite_close($db);    
}

echo <<<endHTML

<center>
     <br>
DANGER THIS BUTTON CLEARS ALL BET DATA 
<form name="clear" method= "post" action="$PHP_self">
<input type="submit" value="CLEAR ALL BET, TOTALCASH AND PAYOUT DATA" name="clear">
</form>
<br>
<Font color="white" size="5">
<br>Goto to horse entry page  >>
<a href="horseadd.html"> click here</a>
endHTML;



?>
